core: Support building with OpenSSL for checksums
authorColin Walters <walters@verbum.org>
Mon, 13 Mar 2017 18:41:14 +0000 (14:41 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 20 Mar 2017 18:32:40 +0000 (18:32 +0000)
commitdf5cbc9be9bb25c6eaeff12db9727d1ba28118a1
tree9cbe2afe294e0b2b59a1be9f500066459c6c2eaf
parentc2f5a999bfd865696b5456858e3cae984fba46f5
core: Support building with OpenSSL for checksums

Add an OpenSSL backend to the checksum input stream, which is where we do a lot
of checksumming (object commit, static deltas).

The raw OpenSSL performance is
[approximately double](https://gist.github.com/cgwalters/169349fd1c06fd4fb4d3a7ce33303222) on
my laptop; not only does OpenSSL have e.g. hand-tuned x86_64 assembly, the
current implementation uses the
[Intel SHA extensions](https://en.wikipedia.org/wiki/Intel_SHA_extensions).

Another reason to do this is I was idly thinking about adding
[Curve25519](https://en.wikipedia.org/wiki/Curve25519) signatures (like e.g.
Alpine does) instead of/in addition to GPG.  The rationale for that is
that GPG is pretty heavyweight, both in code footprint and the simple
fact that EC keys are way smaller.

I didn't benchmark ostree with this; we have bigger performance problems
really like the fact we just malloc way too much.  But, it's a step
in the right direction I think in combination with the libcurl work
where we're linking to openssl anyways.

Closes: #738
Approved by: jlebon
.redhat-ci.yml
configure.ac
src/libostree/ostree-core.c
src/libotutil/ot-checksum-instream.c
src/libotutil/ot-checksum-utils.c
src/libotutil/ot-checksum-utils.h